clean up code in ok filter