some refacto and fix an issue in timey