Encapsulates compression algorithm in method