Move and remove unused consts and globals