re-implement class for prototype inheritance