Restructured code to make easier to edit consts