Package fixes and streamlined code