minor refactoring + removed chmod (not needed)