generalize collect-constants into collect so we can support easly collect-keywords and collect-vars