Moved map components to Layout and cleaned up certain parts of the code