Address code review comments

Error handling logic is easier on the eyes
Added file format reminder in comments