Refactored the getXXXMatrix in order to do it more maintainable.
Merge pull request #12 from SantiMunin/master

Refactored the getXXXMatrix code.