layer panel refactoring