Use parse() instead of custom function