Switching to a more object-oriented approach