Switched to a more object-oriented code pattern