Kjr/refactors

Some more refactors for you to peruse señor.

@tomykaira