more refactoring / modularizing
making the library even more modular