Refactored some code for better testability