Code refactoring
Checking arguments
Code refactoring