Refactor class, remove define, adapt tests