Foodpaint refactor and add test case