make code testable and add initial unit tests