Move helper methods to where they belong