Naming and scope cleanup