Refactoring, fixed linux sed -i flag, restart