expression serialization + refactoring