refactor of compound room