added IDManager to simplyfy resource management