Use correct data type: long instead of int
Add common interfaces to support generic programming