Separation of stateless and stateful functions