ENH move implementation from Rakefile to class