refactor and remove unused