refactored and reduced duplicated code
refactored is_regular/1 and now is_irregular/1
refactored is_regular/1 and now is_irregular/1
refactored in terms of meaningful naming