Clockwork refactoring

closes #1257