refactored before_filter application