deferred refactoring
redirect url moved to config
massive refactoring, fixing bugs