Minor refactor. Methods should go at the top