end point refactor