Moving helper functions out of feature