first step in making the code more structured