began refactor to build definitions array on server