added built-in input handler, validator, redirector and cleaned up a lot of stuff