reorganize code

Start to distinguish between hhu and non-hhu actions, and prepare generic sources.