Code cleanup from copy pasting too much