FXEP-22: Tidied up the code.