Refactored into distinct binary and library files