remove unused method and refactor