Refactor painter slightly to use a variable for the size