Remove unused code and inherit to object instead of property