Fix #16 to add support for pre and post processing