moved some code into header file to get different code by ISA selection