move class definition above companion definition