refactoring and fit for proguard;