refactor and delete