refactoring to limit hardcoding and generate unique id list