types refactored again