a simple state driven object converter