stateful component constructor