Refactor some code and add getAccept method