Cleaned up activation code