Refactoring mechanism to write Java class with SDK version