fix and clean code