Refactored code, cleaned up methods and shortened