Added size/dimension parameterization, refactors