removed view logic from controller