Refactoring used to easier plugin implementation.