The cleaner version of my code