todo and cleanup