Refactor serialisation route