Making code less hard-coded

Needed for search code