Refacter login code for passed JDK 7 compile.