Better parsing for ruby and js