helper method to remove duplication in functional test