Extracting date from filename, refactoring page initialisation