Refactor code

Refactor code to follow the patterns laid out under the puppet
best practices for modules.