Factor out object decoding into multiple files