Cleaned up function param order to reduce code clutter