Adding the type field to tests and refactoring to fix HPT-150