command and observer patterns