Filter optimisations and cleanup part 1