Refactor to use IDs