completed model and clean code