Cleaned up code and added plugin and helper support.