method refactor into spring engine