make separete logic and painting