adopting a different naming for script functions
minor cleanup
refactoring entities