#27 refactored the id extraction function and replaced the relationship one