Refactored sample projects

Implemented the use of shared sample classes.