refactorig order functional