refactoring; integration of layer switcher