refactor so that keys are not hard coded