Subview handling refactoring