refactoring - time span class