some data modifications and agregate functions