more refactoring of structure + add examples