Refactoring Build method
This refactoring separates the responsibilities of checking for crashes and registering meta types into separate functions. This makes it easier to maintain and understand the code, as well as making it easier to change the code in the future if necessary.