Added some configuration and input validation