Finalizes layout and routes