Refactored some methods etc.