reengineering piet core lib