Refactoring of layers