Prevent printing database on console
code refactoring

refactor codevfor realtime average perception graph