Some code cleanup.

refactoring, added missing interface, added marker interface