modify build.gradle
refactor partition method
use final class instead of abstract class