improved type parseing and removed mongoose as a dependency