Refactor functions associated with the likes feature