Shortened / refactored some code.