Refactored to work with feature on multiple layers