refactoring layer selection