use pattern match instead of binary:part/2