Handle ex and ch units
Clean code and fix tests