Restructuring

Restructuring some code + examples