refactor brush specific code to a separate file