Code cleanup merged