refactored to not use sudo