Refactoring: extract function - get-bytes