simplified design structure, implemented factory pattern for decoding