made code much cleaner