simple refactoring
Fixed length of the returned buffer