huge refactoring of dimension wise operations