made code more object-ey