better syntax and code cleanup