Last refactoring and added configurable controls