Recombined implementations into single file.