put logic into paint util