re-organized code a bit to different packages