Make the creation of filters less harcoded
Use events instead of if's, clean up code a little