The structure of topological semigroups