Refactor code but still issue with //c