refactor code and fixed for annotations on time-axis on spectrum