Well that's just the difference between a library and building custom.
A library is by definition supposed to be somewhat generic, adaptable and configurable. That takes a lot of code.