refactor last