updated layout and clean the code