Refactored code
Further refactored