moved helper functions to model