Split up functions and add more support