moved arch dependant code into arch