refactor to get rid of giant object literals