trailing whitespaces
Refactor detection to OOP