:sparkles: fix to remove duplicate code