Made the code cleaner