Made the code more maintainable