Avoid use of static attribute in functions