get the prototype definitions outside of the constructor

Signed-off-by: Tomas Neme <lacrymology@gmail.com>
remove unnecesary variable

Signed-off-by: Tomas Neme <lacrymology@gmail.com>