refactor price determination