Basic cleanup and abstraction.