Create an object with custom state