Split the mixins and functions into separate files. Made minor modifications.