Refactored code with some methods been removed