refactor finish