Refactor my code

Category: Coding
Credit: emredevsalot