code refactoriong 2