Avoid static variable to prevent memory leaks