adding generic functions for models