refactor out painter