Change getEncodePath to static method (hackey)