extracted feature functions into objects.

untested