refactors type specs