Refactor/layer manager