use before_action instead of _filter and cleanup