Extracted validation logic into separate methods
Minor fixes