Some refactoring and adding Elmah