Refactored password comparison by method extraction in controller

Signed-off-by: Rachel Logie <rachel.logie1@gmail.com>