refactor helper methods, change tests