split up accept/reject into functions, change api, comment