Various code improvements, usage remains the same