refactor to clean base