put the bulk of conditions
couple of pep8