as discussed this could be moved to utils