Add some functions which can be used with offset value
Merge branch 'master' into offset
Code cleanup. Remove duplicate codes