updated to make shorter with attr expressions