clean up console app(merge two path into one)

merge code from master branch. same with 5b38a94c9ad9e0