Adding logging and initial test coverage