refactor so that appId is a configuration property