restructure and new code (22-02-2013)