Add simple market recognition
Code refactor