Add some style and hooks. Some code cleanup.