refactored bezier calculations

removed derivative types from the function declarations,
reworked caclulations to be more generic