A new modular implementation for stateful traits