Tmp Checkin - Refactor to add unit tests