Serialize and sanitize file names
Code cleanup