7645: platform specific refactor

move code