Cleaned up wrapper with code folds