Added Java Logging.
Fixed magic number issues and etc.