Code cleanup, refactor, logging infrastructure used, ip tracked