cleanup and refactor
refactor into plugins complete but still a little sucky