completed tip refactor