wrote helper methods for models