Cleaned up code

made allocate tests html generic to avoid code reuse