Refactoring empty state. Rearrange code / functions for future multirelease testing
PEP8 fix