Irrelevant helper functions removed