initial refactor of operators code