small refactor on longtext