Delete some dead code / cleanup
Refactor: compute target only once