Move buffer limits to more generic place