use condition instead or try-except for non-anomalous behavior
moved more code inside methods