Removed static variables which were not read-only and used more function parameters instead.