Would be better if this method throws an exception more high level exception instead of IOException