Factorised origin shift, refraction and reflection into separate functions