add validates and clean code