code refactored and structured as packages