added some console tools; did refactoring; fixed login code;