code re factored to be more readable
another re-factor commit