Replaced prototype with inheritance