refactor duplicate code

This can be a way to remove this duplicate code form order Common without big performance Impact.