Made code much cleaner