Refactored elk stack into a module