Optimize Query
Add color constants && tidy some functions
Merge branch 'devel'