use class method instead of hackery