cleaned up code
Cleaned up BaseHandler