package refactor and other minor changes