minor refactor, private variable names and pragma once