Fixed repeat lines in code