Small refactor on Pharrell module