Refactored into static library