code cleanup
prepared work for implement queries