moved APP_ID constant out of module
some minor refactoring