[refac] extract accept function