[Refactoring] Move time layer stuff to new file