configuration refactor. added config tests