Changed the order of some methods for better style