Refactoring

Keep fixing bugs and improve the layouts