it had taken several miserable months working as a scrub boy in bethlem hospital for the insane , known to the locals as bedlam ; cleaning out the filth and squalor from the cells of the lunatics , before he had been promoted to doctors boy .