before changing everything to OOP