use conditional get instead of head request
cleanup & fix content replacement