remove unused code and update method invocation based on @lizluxs