Code refactoring

Test console app was refactored.
SDK codes were refactored.