Fix for these
Some refactoring
Switch this to better parameterization
Some refactoring