Refactored views and fixed validaton login