mixins and functions: remove spaces and clean up code formatting