refactor templates
refactor template login
implement consultations resource