init refactoring matrix helper classes
simplifying matrix helper classes