Refactoring api to be more logic.