refactored libs and prepped for unit testing of the libs