(*) Removing TODOs. Adding javadocs and loggers where needed.