Refactored and polished

Refactored and polished plugin config seperation, having issues with
variable replacement