Move math operations to classes