Replace self by static and fix function declaration