Refactor login using CForm