Fixed some bad practices