Added code for Single responsibility principle