Made code closer to conform to clean code standards