[#662] Code improvement, use Long.valueOf directly

* Based on code review from @muloem