OP-984 Refactoring.
OP-984 Small fixes after re-factoring.