design changes; fixing / organizing some code; fixing num of redirects issue