Addional refactoring to make class less complex and dry it up