cleanup and bugfix

added constants to common.py

fixed visibility bug

simplified logic on main page

minor cosmetic cleanup