refactored the id return