Use interfaces instead of plain functions
Move haystack to constructor
Upgrade interface with initialization method