new package structure, logging, refactoring, comments and java doc