restructuring behaviour and login