refactor security interceptor