refactoring to be able to build non-x86 devices