Refactorings...
Finished implementation of the main layout