Refactor code and fix light ratio