helper methods and tests