fixed possible IOException
changed executeSudo() to return command result
refactoring code