clean code and change api name