What keeps insomnia going, once it has started
There is a well tested account of the maintaining part, and it names the things you are probably doing right now.
What the research says
Harvey AG (2002). A cognitive model of insomnia. Behaviour Research and Therapy, 40(8), 869 to 893 doi
Describes what keeps insomnia running once the original cause has gone: a mind that is busy and negative at night, attention that goes hunting for signs of a bad night, a habit of judging your own sleep as worse than it was, and a set of protective habits that make the next night harder. It is the account that makes clock watching and counting the hours worth treating as problems in their own right rather than as harmless symptoms.