Refactored.
Refactoring and cleanup.

Refactoring and cleanup. Removed sample directory.