Refactor with before_filter