android patch refactor