Modified for easier testing