Move convert method earlier to improve readability