some thoughts about refactor