continuing refactor of library