Cleaned up code in views. Removed some magic numbers.