Move ACF logic into module