fixing CS problems
using getConfiguration and removing unnecessary end statements