clean code and fix view