moved hardware detection code to another package, minor fixes