move calcs into object