improve code quality & add --print expansion