Added hydrators and cleaned up code