Extracting timestamp + refactoring