Added consent form and some refactoring