Cleaned up bash wrapper code