daily checkin

more refactoring and added test code