moved all functionality with file to file.inc and added remove file callback