Refactored code to separate options
rename config lib
fix a bug on plugin resources normalization