made mode configurable for testing