Refactoring Code and improve views