Refactored a bit to make for a smooth install