Refactor this section similarly as discussed above (using manager functions).