factor utils and gl utils out of activity