clean js functions and add comment and explicit default_filter use