subclass or function?