remove duplicate codes, create tests for user update view