Cleanup codes.  Replace var with  val, Remove redundant `return`, and so on.