fix bug in template seperate check between methods and variables
refactor formatting
decapsulate module.exports check from entity check