Added OperationType. Refactoring js.