write methods for models