Fix ambiguous fucntion call, slight rmoval of redundant code