move average function to place model
Merge branch 'master' of https://github.com/appsgate2015/appsgate