Code cleanup, new logtype, new command