Added GP filter and small refactoring