minor refactoring + bugfixing + tmp commented VS2013, JDK