add file#rewrites
platform file fixes
cleanup