Define interfaces more clearly and clean up code.