refactored markup (and messed up serialization)