Remove unused code, remove magic number