refactor to allowedMethod