refactor some classes. Sample integrates KZApplication