Created tests for added methods and refactored some code