Units testing and simplification