Made code much more cleaner