adjust and clean code