Build matrix refactoring