refactor to use serialiser class