Refactor get instance method using inheritance