some refactoring in intention