refactored tests and added better configuration management