Refactor, add time selector