refactored for accept and reject