Bundle patch tests + minor refactoring