refactored to remove flags, added store js, etc