refactoring controller for velocity trend chart