app layouts refactoring

https://trello.com/c/qmR8ybQx/2-layouts-change-logic