model persistence methods with tests