added 'hostname_cmd' hostname method, code cleanup