refactor the library architecture to include proper autoload