added parsing and logic for types