Addional refactoring to make class less complex and dry it up

Inconsistent indentation detected.