Actually, both data and dateformat are serializable, so you can initialize them at the declaration. Then you need no open method, which makes the code nicer.