Improve navigation filtering

Previous solution was too verbose. This is cleaner and easier to use.