added more scenarios, refactored