code style improvements. matrices extension methods