split pure and STM code