New iris.inherits function, small code refactoring