Remove unnecessary dependency
Fix abspath on win
Separate file operation functions from main