Some minor refactors

Mainly using enumerable methods.