refactored code to make use of default_attr instead of relying on super