Refactor handler + location intialization, allow module variables for handlers