refactor status and click handling