Change to procedural paradigm