refactor, add xstream